package com.tedu.egweibo.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class UserRegDTO {
    @NotNull
    @Pattern(regexp = "[\\u4e00-\\u9fa5A-Za-z0-9_]{1,30}",message = "用户名只能是中文或者英文数字_，长度在1-30之间")
    @ApiModelProperty(value = "昵称",required = true,example = "张三")
    private String nickname;

    @NotNull
    @Pattern(regexp = "[A-Za-z0-9_]{6,30}",message = "密码只能是英文数字_,长度在6-30之间")
    @ApiModelProperty(value = "密码",required = true,example = "123456")
    private String password;

    @NotNull
    @Pattern(regexp = "[\\u4e00-\\u9fa5A-Za-z0-9_]{1,30}",message = "用户名只能是中文或者英文数字_，长度在1-30之间")
    @ApiModelProperty(value = "用户名",required = true,example = "张三")
    private String username;
}
